using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml;

namespace DoAn
{
    public partial class FormXepHang : Form
    {
        private XmlDocument HighScoreDoc;
        private XmlElement HighScore;

        public FormXepHang()
        {
            InitializeComponent();
        }

        //ham load diem
        private void LoadHighScore()
        {
            HighScoreDoc = new XmlDocument();
            HighScoreDoc.Load("../../HighScore.xml");
            HighScore = HighScoreDoc.DocumentElement;
        }

        private void PanelHighScore()
        {

            XmlNodeList HighScoreList = HighScore.ChildNodes;

            lblHSName1.Text = ((XmlElement)HighScoreList[0]).GetAttribute("Name");
            lblHSScore1.Text = ((XmlElement)HighScoreList[0]).GetAttribute("Score");
            lblHSName2.Text = ((XmlElement)HighScoreList[1]).GetAttribute("Name");
            lblHSScore2.Text = ((XmlElement)HighScoreList[1]).GetAttribute("Score");
            lblHSName3.Text = ((XmlElement)HighScoreList[2]).GetAttribute("Name");
            lblHSScore3.Text = ((XmlElement)HighScoreList[2]).GetAttribute("Score");
            lblHSName4.Text = ((XmlElement)HighScoreList[3]).GetAttribute("Name");
            lblHSScore4.Text = ((XmlElement)HighScoreList[3]).GetAttribute("Score");
            lblHSName5.Text = ((XmlElement)HighScoreList[4]).GetAttribute("Name");
            lblHSScore5.Text = ((XmlElement)HighScoreList[4]).GetAttribute("Score");
            lblHSName6.Text = ((XmlElement)HighScoreList[5]).GetAttribute("Name");
            lblHSScore6.Text = ((XmlElement)HighScoreList[5]).GetAttribute("Score");
            lblHSName7.Text = ((XmlElement)HighScoreList[6]).GetAttribute("Name");
            lblHSScore7.Text = ((XmlElement)HighScoreList[6]).GetAttribute("Score");
            lblHSName8.Text = ((XmlElement)HighScoreList[7]).GetAttribute("Name");
            lblHSScore8.Text = ((XmlElement)HighScoreList[7]).GetAttribute("Score");
            lblHSName9.Text = ((XmlElement)HighScoreList[8]).GetAttribute("Name");
            lblHSScore9.Text = ((XmlElement)HighScoreList[8]).GetAttribute("Score");
            lblHSName10.Text = ((XmlElement)HighScoreList[9]).GetAttribute("Name");
            lblHSScore10.Text = ((XmlElement)HighScoreList[9]).GetAttribute("Score");
        }

        private void FormXepHang_Load(object sender, EventArgs e)
        {
            tblHighScore.Visible = true;
            LoadHighScore();
            PanelHighScore();
        }
    }
}